import UIKit

public struct SyntaxTheme {
    public struct TokenType {
        public let color: UIColor
        public let font: UIFont?
        public let backgroundColor: UIColor?
        
        public init(
            color: UIColor,
            font: UIFont? = nil,
            backgroundColor: UIColor? = nil
        ) {
            self.color = color
            self.font = font
            self.backgroundColor = backgroundColor
        }
    }
    
    public let plainText: TokenType
    public let comment: TokenType
    public let keyword: TokenType
    public let string: TokenType
    public let type: TokenType
    public let number: TokenType
    public let identifier: TokenType
    public let customType: TokenType
    public let preprocessor: TokenType
    public let url: TokenType
    public let attribute: TokenType
    public let regex: TokenType
    
    public init(
        plainText: TokenType,
        comment: TokenType,
        keyword: TokenType,
        string: TokenType,
        type: TokenType,
        number: TokenType,
        identifier: TokenType,
        customType: TokenType,
        preprocessor: TokenType,
        url: TokenType,
        attribute: TokenType,
        regex: TokenType
    ) {
        self.plainText = plainText
        self.comment = comment
        self.keyword = keyword
        self.string = string
        self.type = type
        self.number = number
        self.identifier = identifier
        self.customType = customType
        self.preprocessor = preprocessor
        self.url = url
        self.attribute = attribute
        self.regex = regex
    }
    
    public static let xcode = SyntaxTheme(
        plainText: TokenType(color: .black),
        comment: TokenType(color: UIColor(hex: "#536579")),
        keyword: TokenType(color: UIColor(hex: "#9B2393")),
        string: TokenType(color: UIColor(hex: "#C41A16")),
        type: TokenType(color: UIColor(hex: "#0B4F79")),
        number: TokenType(color: UIColor(hex: "#1C00CF")),
        identifier: TokenType(color: UIColor(hex: "#000000")),
        customType: TokenType(color: UIColor(hex: "#0B4F79")),
        preprocessor: TokenType(color: UIColor(hex: "#643820")),
        url: TokenType(color: UIColor(hex: "#0E0EFF")),
        attribute: TokenType(color: UIColor(hex: "#836C28")),
        regex: TokenType(color: UIColor(hex: "#C41A16"))
    )
    
//    public static let dracula = SyntaxTheme(
//        plainText: TokenType(color: UIColor(hex: "#F8F8F2")),
//        comment: TokenType(color: UIColor(hex: "#6272A4")),
//        keyword: TokenType(color: UIColor(hex: "#FF79C6")),
//        string: TokenType(color: UIColor(hex: "#F1FA8C")),
//        type: TokenType(color: UIColor(hex: "#8BE9FD")),
//        number: TokenType(color: UIColor(hex: "#BD93F9")),
//        identifier: TokenType(color: UIColor(hex: "#F8F8F2")),
//        customType: TokenType(color: UIColor(hex: "#8BE9FD")),
//        preprocessor: TokenType(color: UIColor(hex: "#FF79C6")),
//        url: TokenType(color: UIColor(hex: "#8BE9FD")),
//        attribute: TokenType(color: UIColor(hex: "#50FA7B")),
//        regex: TokenType(color: UIColor(hex: "#F1FA8C"))
//    )
//    
//    public static let github = SyntaxTheme(
//        plainText: TokenType(color: UIColor(hex: "#24292E")),
//        comment: TokenType(color: UIColor(hex: "#6A737D")),
//        keyword: TokenType(color: UIColor(hex: "#D73A49")),
//        string: TokenType(color: UIColor(hex: "#032F62")),
//        type: TokenType(color: UIColor(hex: "#6F42C1")),
//        number: TokenType(color: UIColor(hex: "#005CC5")),
//        identifier: TokenType(color: UIColor(hex: "#24292E")),
//        customType: TokenType(color: UIColor(hex: "#6F42C1")),
//        preprocessor: TokenType(color: UIColor(hex: "#D73A49")),
//        url: TokenType(color: UIColor(hex: "#032F62")),
//        attribute: TokenType(color: UIColor(hex: "#22863A")),
//        regex: TokenType(color: UIColor(hex: "#032F62"))
//    )
//    
//    public static let oneDark = SyntaxTheme(
//        plainText: TokenType(color: UIColor(hex: "#ABB2BF")),
//        comment: TokenType(color: UIColor(hex: "#5C6370")),
//        keyword: TokenType(color: UIColor(hex: "#C678DD")),
//        string: TokenType(color: UIColor(hex: "#98C379")),
//        type: TokenType(color: UIColor(hex: "#E5C07B")),
//        number: TokenType(color: UIColor(hex: "#D19A66")),
//        identifier: TokenType(color: UIColor(hex: "#ABB2BF")),
//        customType: TokenType(color: UIColor(hex: "#E5C07B")),
//        preprocessor: TokenType(color: UIColor(hex: "#C678DD")),
//        url: TokenType(color: UIColor(hex: "#61AFEF")),
//        attribute: TokenType(color: UIColor(hex: "#98C379")),
//        regex: TokenType(color: UIColor(hex: "#98C379"))
//    )
}
